package com.merak.miner.data.provider.controller;

import com.alibaba.fastjson.JSONObject;
import com.merak.miner.data.kafka.config.KafkaProducer;
import com.merak.miner.data.persist.entity.Crm;
import com.merak.miner.data.persist.entity.EsmpDataCondition;
import com.merak.miner.data.persist.mapper.CrmMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import lombok.extern.slf4j.Slf4j;

import java.util.Random;
import java.util.UUID;

@Slf4j
@RestController
@RequestMapping("/merak/data/provider")
public class DataProcessRestController {

//    @Autowired
//    private KafkaProducer kafkaProducer;

    @Autowired
    private CrmMapper crmMapper;

    @RequestMapping("/data_process")
    public String DataProcess(){
       Crm c= crmMapper.load(1);
       log.info("crm:{}", JSONObject.toJSONString(c));
        return "ok";
    }

//
//    @RequestMapping("/sendKafkaData")
//    public String sendKafkaData(){
//        Crm crm=new Crm();
//        crm.setId(1);
//        crm.setCustOrderId(UUID.randomUUID().toString());
//        crm.setCustOrderNbr(UUID.randomUUID().toString());
//        crm.setPm2oss("2021-11-18");
//        crm.setPmDone("2021-11-19");
//        kafkaProducer.send(crm);
//        return "ok";
//    }

    
}
